<?php
/**
 * Created by PhpStorm.
 * Author: D H
 * Date: 2017/6/16
 * Time: 14:14
 */

namespace app\android\controller;

use app\api\logic\Cat as Cats;
use think\Request;
use tool\Common;

class Cat extends Base {

    //得到顶级分类
    public function getTopCatList(){
        return json((new Cats($this->request))->getTopCatList());
    }
    //根据顶级分类ID得到下属所有分类
    public function getCatListByTopCatID(){
        return json((new Cats($this->request))->getCatListByTopCatID());
    }
    //根据分类ID得到品牌列表
    public function getBrandListByCatID(){
       /* $data = json_decode(Request::instance()->getInput(),true);
        $object = new Cats();
        $package = $object->init($data)->getBrandListByCatID();
        Common::json($package);
        //dump($package);*/
        return json((new Cats($this->request))->getBrandListByCatID());

    }
}